home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 920324-01 < prev    next >
Encoding:
Internet Message Format  |  1992-05-19  |  4.0 KB

  1. From: cons@mercury.cern.ch (Lionel Cons)
  2. Newsgroups: alt.security
  3. Subject: X Lack of Security
  4. Message-ID: <CONS.92Mar24173517@mercury.cern.ch>
  5. Date: 24 Mar 92 16:35:17 GMT
  6. Organization: CERN, European Research Center for Particle Physics
  7.  
  8. X is not secure, how can we live with it ?
  9.  
  10. Few days ago I've asked the following questions (in comp.windows.x):
  11.  
  12. > 1) How can I prevent a user from machine 'foo' to access the display
  13. > 'foo:0'? By accessing I mean run a program that will open a connection
  14. > to that display.
  15. > 2) How can I allow someone from machine 'bar' to access the display
  16. > 'foo:0' without allowing it for EVERYBODY from machine 'bar'? In other
  17. > words, is there a way to control display access without using xhost?
  18. > 3) How can I have the list of all the clients (even without window)
  19. > connected to my display? I'd like to have many informations like:
  20. > machine where the client run, user id of the remote process...
  21.  
  22. Here are some ideas:
  23.  
  24. There are two security mechanisms in X: xhost and xauth.
  25.  
  26. - xhost only allows a per machine control, this implies that:
  27.   * all users of machine A can run xhost to modify the access list for
  28.     display A:0 and do what they want, it is a big problem when the
  29.     machines use the Yellow Pages: all users can log into all machines...
  30.   * you can't allow a user from machine B to access display A:0 without
  31.     allowing ALL users from machine B to access A:0.
  32.   The man page says:
  33.       The xhost program is used to add and delete hosts to the list of
  34.       machines that are allowed to make connections to the X server.  This
  35.       provides a rudimentary form of privacy control and security.  It is
  36.       only sufficient for a workstation (single user) environment, although
  37.       it does limit the worst abuses.  Environments which require more
  38.       sophisticated measures should use the hooks in the protocol for
  39.       passing authentication data to the server.
  40.  
  41. - xauth allows a per user control, it is not in X11R3 distribution. This it
  42.   how it works (at least on my machine):
  43.   * you must start the server with the -auth option
  44.   * a 'magic cookie' is created
  45.   * to allow a user to access the display you must give him the cookie
  46.     with xauth.
  47.   The man page (for Xserver) says:
  48.       The sample server implements a simplistic authorization protocol,
  49.       MIT-MAGIC-COOKIE-1 which uses data private to authorized clients and
  50.       the server.  This is a rather trivial scheme; if the client passes
  51.       authorization data which is the same as the server has, it is allowed
  52.       access.  This scheme is worse than the host-based access control
  53.       mechanisms in environments with unsecure networks as it allows any
  54.       host to connect, given that it has discovered the private key.  But in
  55.       many environments, this level of security is better than the host-
  56.       based scheme as it allows access control per-user instead of per-host.
  57.  
  58. The 2 mechanisms can run together, if so the protection is minimum (i.e. the
  59. connection is accepted if one of the 2 mechanisms accept it).
  60.  
  61. Here are some answers:
  62.  
  63. 1) There is no way of preventing a user from machine A to access the display A:0.
  64.    The user can always use xhost (unless the owner and modes are not standard but
  65.    the user can use its own copy...).
  66.  
  67. 2) Use the xauth mechanism and hope that nobody will steal your cookies...
  68.  
  69. 3) If you want to list clients WITH windows use xlsclients.
  70.    If you want to list clients WITHOUT windows use netstat -a and look for
  71.    connection to the X server (for instance TCP on port 6000).
  72.  
  73. Conclusion: X is not secure, when you type something in a window you can be sure
  74. that someone can read it... Big Brother and Little Hacker are watching you...
  75.  
  76. Thanks to all who responded: Roland Zink, Dipankar Gupta and George D M Ross.
  77. --
  78.  
  79. Lionel Cons
  80.  
  81. +------- CERN - European Laboratory for Particle Physics -------+
  82. | E-mail: cons@dxcern.cern.ch                                   |
  83. | Earth-mail: CN/SW/WS, CERN, CH-1211 GENEVE 23, Switzerland    |
  84. | Phone: + 41 22 767 2370                                       |
  85. +---------------------------------------------------------------+
  86.  
  87.